package com.datong.server.strategy.calculatePrice;

/**
 * 打折，如7折，8折
 * */
public class DiscountCashStrategy extends StrategyCash {
    private double discount;
    public DiscountCashStrategy(double discount){
        this.discount = discount;
        this.discount = this.discount / 10;
    }
    @Override
    public double getResult() {
        System.out.println("当前折扣为：" + this.discount * 10);
        double result = this.getNumber() * this.getUnit();
        return result * discount;
    }
}
